package Model;

import java.io.Serializable;
import java.util.ArrayList;

/*
 * @author Roch San Buenaventura
 */

public class CardTypePayPlayers extends Card implements Serializable 
{
	private int Amount_;
	final static long serialVersionUID = 204;
	
	public CardTypePayPlayers() 
	{
		Message_ = "NONE";
		Amount_ = 0;
	}
	
	public CardTypePayPlayers(String message, int amount) 
	{
		Message_ = message;
		Amount_ = amount;
	}
	
	public int getAmount() 
	{
		return Amount_;
	}
	
	public void setAmount(int amount) 
	{
		Amount_ = amount;
	}
	
	public void landOn(Player p, ArrayList<Player> players) 
	{
		for (int i = 0; i < players.size(); ++i) 
		{
			if (i != p.getIndex()) 
			{
				p.updateCash(-getAmount());
				players.get(i).updateCash(getAmount());
			}
		}
	}
}
